<%@ include file="/common/taglibs.jsp"%>
<%--<ajax:displayTag id="displayTagFrame" ajaxFlag="displayAjax">--%>
<display:table name="registrations" cellspacing="0" cellpadding="0" requestURI=""
    id="registrationList" pagesize="1000" class="table registrationList" export="true" decorator="org.displaytag.decorator.TotalTableDecorator">

    <display:column escapeXml="false" sortable="true" sortProperty="id"
        titleKey="registration.id">
	 <a href="#" onclick="javascript: getHTML('get=&id=${registrationList.id}','editRegistration');return false;">${registrationList.id}</a>
	</display:column>

    <display:column property="ticketNumbers" escapeXml="true" sortable="true"
         titleKey="registration.ticketNumbers"/>
    <display:column property="firstName" escapeXml="true" sortable="true"
         titleKey="registration.firstName"/>
    <display:column property="lastName" escapeXml="true" sortable="true"
         titleKey="registration.lastName"/>
    <display:column property="phone" escapeXml="true" sortable="true"
         titleKey="registration.phone"/>
    <display:column property="email" escapeXml="true" sortable="true"
         titleKey="registration.email"/>
    <display:column property="numberTickets" escapeXml="true" sortable="true" total="true"
         titleKey="registration.numberTickets"/>
    <display:column property="numberKids" escapeXml="true" sortable="true"
         titleKey="registration.numberKids"/>
    <display:column property="amtPaid" escapeXml="true" sortable="true"
         title="Amt Pre-Registration"/>
    <display:column property="amtPaidAtRegistration" escapeXml="true" sortable="true"
         title="Amt At Registration"/>
    <display:column property="paymentMethod" escapeXml="true" sortable="true"
         titleKey="registration.paymentMethod"/>
    <display:column property="willAttend" escapeXml="true" sortable="true"
         titleKey="registration.willAttend"/>
    <display:column property="notes" escapeXml="true" sortable="true"
         titleKey="registration.notes"/>
    <display:column property="checkedIn" escapeXml="true" sortable="true"
         title="Checked In"/>
    <display:column property="onlinePurchase" escapeXml="true" sortable="true"
         title="Online Purchase"/>
    <display:setProperty name="paging.banner.item_name" value="registration"/>
    <display:setProperty name="paging.banner.items_name" value="registrations"/>
</display:table>
<%--</ajax:displayTag>--%>

<script type="text/javascript">
    highlightTableRows("registrationList");
</script>

<script type="text/javascript">
    function replaceLinks() {
        // replace all the links in <thead> with onclick's that call AjaxAnywhere
        var sortLinks = $('registrationList').getElementsByTagName('thead')[0]
                                     .getElementsByTagName('a');
        ajaxifyLinks(sortLinks);

        if (document.getElementsByClassName('pagelinks').length > 0) {
            var pagelinks = document.getElementsByClassName('pagelinks')[0]
                                    .getElementsByTagName('a');
            ajaxifyLinks(pagelinks);
        }

    }
    function ajaxifyLinks(links) {
        for (i=0; i < links.length; i++) {
            links[i].onclick = function() {
                getHTML(this.href.split("?")[1]);
                return false;
            }
        }
    }
    replaceLinks();
</script>
